<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page import="com.bafa.objects.season.Season" %>
<%@ page import="com.bafa.objects.season.Division" %>
<%@ page import="com.bafa.objects.team.Team" %>
<%@ page import="com.bafa.objects.team.TeamSeasonStats" %>
<%@ page import="com.bafa.objects.team.TeamStats" %>
<%@ page import="com.bafa.objects.player.*" %>
<%@ page import="com.bafa.objects.*" %>
<%@ page import="com.bafa.middle.*" %>
<%@ page import="com.bafa.front.presentationbeans.*" %>
<%@ page import="com.bafa.front.utils.*" %>
<%@ page import="java.util.*" %>
<%
User user = (User)session.getAttribute("LOGGEDON");
%>
<% PageBean pageBean = (PageBean)request.getAttribute("PAGEBEAN"); %>
<% SeasonBean season = (SeasonBean)session.getAttribute("THISSEASON");   
if(season==null){season = (SeasonBean)request.getAttribute("CURRENTSEASON");}  %>
 <% TeamBean team = (TeamBean)session.getAttribute("LOGGEDONTEAM");%>
 <% LeagueBean division = (LeagueBean)session.getAttribute("DIVISION");%>
 
 <% PlayerListBean scorers = (PlayerListBean)request.getAttribute("TOPSCORERS");%>
 <%SeasonBean[] allSeasons = ((SeasonListBean)session.getAttribute("ALLSEASONS")).seasons();

 %>
 <%SiteBean siteBean = (SiteBean)session.getAttribute("SITEBEAN");%>
 <%String sitename = (String)request.getAttribute("SITENAME");%>
 <%
 String lhs = "lhstemplates/"+pageBean.getLhs();
 %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link type="text/css" media="screen" rel="stylesheet" href="<%=siteBean.getStylesheet()%>" />

<script  src="script/niftycube.js" type="text/javascript" ></script>
<script>function gone(form){
   window.location = form.value;
}
	</script>


<title><%=sitename%> - <%=pageBean.getMainheader()%></title>

<script>
function checkLogon(form){

if(form.user.value=='Username'){  
alert('You must enter in a valid username');
}else if(form.user.value=' '){
alert('You must enter in a valid username');
}else{
form.action=logon.bafa;
form.submit();
}
}
</script>
<script type="text/javascript">
window.onload=function(){
Nifty("div#header","big bl br tr");
}
</script>
</head>

<body>
<%if(JSPUtils.isDisplayed("showads")){%>
<div id="leftside">

</div>
<div id="rightside">

</div>
<%}%>
<div id="container">

	<div id="header">
		<div id="topmenu"><a href="rules.bafa"><%=sitename%> Rules</a> </div>
		<h1><%=sitename%></h1>
		
		
	</div>

	<div id="menu">
		<ul>
		<li<%if(pageBean.getId().equals("home")){%> id="current"<%}%> ><a href="index.jsp">Home</a></li>
		<%for(int divisions=1;divisions<=season.getLeagueList().divisions().length;divisions++){ %>
		<li <%if(pageBean.getId().equals("league")&&divisions==division.getDivisionId()){%>id="current"<%}%>><a href="master?page=league&Division=<%=divisions%>&SeasonId=<%=season.getId()%>">Division <%=divisions%></a></li>
		<%if(division!=null && divisions==division.getDivisionId()){%>
		<li <%if(pageBean.getId().equals("results")){%>id="current"<%}%>><a href="results.bafa?divisionId=<%=divisions%>&seasonId=<%=season.getId()%>">Results</a></li>
		<li <%if(pageBean.getId().equals("fixtures")){%>id="current"<%}%>><a href="fixtures.bafa?divisionId=<%=divisions%>&seasonId=<%=season.getId()%>">Fixtures</a></li>
		<%}}%>
                <%if(JSPUtils.isPricesDisplayed()){%><li <%if(pageBean.getId().equals("links")){%>id="current"<%}%>><a href="master?page=links">Prices and Packages</a></li><%}%>
                <%if(JSPUtils.isPricesDisplayed()){%><li <%if(pageBean.getId().equals("order")){%>id="current"<%}%>><a href="master?page=order">Setup account</a></li><%}%>
                
		</ul>

                
	</div>

	<div id="sidebar">
<form name="jumpy">
	<select name="example" size="1" onChange="gone(this)">
	<option value=""><b>Pick a Season</b></option>
	<%for(int i=0;i<allSeasons.length;i++){%>
	<%if(allSeasons[i]!=null){%>
	<option value="master?page=league&SeasonId=<%=allSeasons[i].getId()%>" <%if(allSeasons[i].getId()==season.getId()){%>selected<%}%>><b><%=allSeasons[i].getName()%> <%=allSeasons[i].getYear()%></b></option><%}%>
	<%}%>
	</select>
	
</form>
<br/>
	<%if(user==null){%>
	<br /><h4>Login</h4>
	<form action="master?page=dologon"  name="logon" method="post">
	<input type="text" onFocus="javascript:this.value=''" name="user" value="Username" />
	<input type="password" onFocus="javascript:this.value=''" name="password" value="Password" />
	Remember me: <input type="checkbox" name="rememberme" value="true"/><br/>
	<input type="submit"  value="Login" />
	<br/>
	<br/>
	</form>
	<%}else{%>
	<br />
	<h4>User Details</h4>

	<strong>Welcome <a href="master?page=dologon"><%=user.getUserId()%></a></strong>
	<br/>
	<form action="logout.bafa"><input type='submit' name='submit' value='Logout' /></form>
	<%}%>
<p>&nbsp;</p>

<p>
	
	<jsp:include page="<%=lhs%>" flush="true"/>
	</p>
	
	<p>
	<%if(JSPUtils.isDisplayed("showmatchreports")){%>
		<h4>Season Stories</h4>
		
		<ul>
				<%HashMap reportIds = new HashMap();%>
				<%if(ReportServices.getSeasonReports(season.getId())!=null){%>
				<%for(int i=ReportServices.getSeasonReports(season.getId()).size()-1;i>=0;i--){Report report = (Report)ReportServices.getReport((String)ReportServices.getSeasonReports(season.getId()).get(i)); %>
				<%if(!reportIds.containsKey(report.getReportId())&&!report.getTitle().equals("")){%>
				<li> <a href='viewmatchreport.bafa?matchId=<%=report.getMatchId()%>' alt=''> <%=report.getTitle()%> </a></li>
				<% reportIds.put(report.getReportId(),report.getReportId());}%>
				<%}%>
				<%}%>
		</ul>
		<%}%>
		
		
	</p>
	
	
	<p>&nbsp;</p>
	<p>
	
</p>


	</div>

	<div id="content">
	
	<h2><%=pageBean.getPageheader()%></h2>
	<p><jsp:include page="messageinclude.jsp" flush="true"/></p>
	<p><jsp:include page="<%=pageBean.getMainbody()%>" flush="true"/></p>
	
	</div>

	
	<div id="footer">
	<%if(JSPUtils.isDisplayed("showads")){%><img src="o.gif" height="25"><br/><p><script type="text/javascript"><!--
google_ad_client = "pub-6472542554945036";
/* 728x15, created 3/4/08 */
google_ad_slot = "0583024628";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p><%}%>
	<p>&copy; 2008 MyFootyLeague.com |  DESIGN BY <a href="http://www.myfootyleague.com">MyFootyLeague.com</a> | <a href="http://validator.w3.org/check?uri=referer">XHTML</a> 1.0 TRANSITIONAL</p>
	</div>

</div>

</body>
</html>
